//
//  AFHTTPSessionManager+KLRACSupport.h
//  KoalaUtilKit
//
//  Created by Tommy on 15/1/10.
//  Copyright (c) 2015年 Koala Team. All rights reserved.
//

#import "AFHTTPSessionManager.h"
#import "ReactiveCocoa.h"

@interface AFHTTPSessionManager (KLRACSupport)

/// A convenience around -GET:parameters:success:failure: that returns a cold signal of the
/// resulting JSON object or error.
- (RACSignal *)klrac_GET:(NSString *)path parameters:(id)parameters;

/// A convenience around -HEAD:parameters:success:failure: that returns a cold signal of the
/// resulting JSON object or error.
- (RACSignal *)klrac_HEAD:(NSString *)path parameters:(id)parameters;

/// A convenience around -POST:parameters:success:failure: that returns a cold signal of the
/// result.
- (RACSignal *)klrac_POST:(NSString *)path parameters:(id)parameters;

/// A convenience around -POST:parameters:constructingBodyWithBlock:success:failure: that returns a
/// cold signal of the resulting JSON object or error.
- (RACSignal *)klrac_POST:(NSString *)path parameters:(id)parameters constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block;

/// A convenience around -PUT:parameters:success:failure: that returns a cold signal of the
/// resulting JSON object or error.
- (RACSignal *)klrac_PUT:(NSString *)path parameters:(id)parameters;

/// A convenience around -PATCH:parameters:success:failure: that returns a cold signal of the
/// resulting JSON object or error.
- (RACSignal *)klrac_PATCH:(NSString *)path parameters:(id)parameters;

/// A convenience around -DELETE:parameters:success:failure: that returns a cold signal of the
/// resulting JSON object or error.
- (RACSignal *)klrac_DELETE:(NSString *)path parameters:(id)parameters;

@end
